﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:demonstrationShowcases="clr-namespace:WPFSample.DemonstrationShowcases"
                    xmlns:wpfSample="clr-namespace:WPFSample">
    <DataTemplate DataType="{x:Type demonstrationShowcases:DynamicExternalDependencyVM}">
        <DataTemplate.Resources>
            <wpfSample:CustomBooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"></wpfSample:CustomBooleanToVisibilityConverter>
            <wpfSample:CustomBooleanToVisibilityConverter x:Key="BooleanToVisibilityConverterInverted"
                                                          Inverted="True"></wpfSample:CustomBooleanToVisibilityConverter>
        </DataTemplate.Resources>
        <Viewbox>
            <Grid Background="White"
                  Width="1366"
                  Height="768">
                <TextBlock HorizontalAlignment="Left"
                           Margin="60,157,0,0"
                           TextWrapping="Wrap"
                           Text="A:"
                           VerticalAlignment="Top"
                           Foreground="#FF170101"
                           FontSize="48" />
                <TextBlock HorizontalAlignment="Left"
                           Margin="65,303,0,0"
                           TextWrapping="Wrap"
                           Text="B:"
                           VerticalAlignment="Top"
                           Foreground="#FF170101"
                           FontSize="48" />
                <TextBlock HorizontalAlignment="Left"
                           Margin="396,34,0,0"
                           TextWrapping="Wrap"
                           VerticalAlignment="Top"
                           FontSize="24"
                           FontStyle="Italic">
    		<Run Foreground="#FF170101"
                    Text="Dynamic External Object Dependency Demonstration" />
    		<LineBreak />
    		<Run Foreground="#FF170101" />
                </TextBlock>
                <TextBlock HorizontalAlignment="Left"
                           Margin="62,551,0,0"
                           TextWrapping="Wrap"
                           VerticalAlignment="Top">
    		<Run Foreground="#FF1B1818"
                    FontSize="21.333"
                    Text="Legend:" />
                </TextBlock>
                <Ellipse Fill="#FF454595"
                         HorizontalAlignment="Left"
                         Height="35"
                         Margin="62,613,0,0"
                         Stroke="Black"
                         VerticalAlignment="Top"
                         Width="35" />
                <TextBlock HorizontalAlignment="Left"
                           Margin="188,621,0,0"
                           TextWrapping="Wrap"
                           VerticalAlignment="Top"
                           Foreground="#FF0A0101"
                           Height="22"
                           FontSize="16">
    		<Run Text="Evaluated Property (Read Only)" />
    		<LineBreak />
    		<LineBreak />
    		<Run />
                </TextBlock>
                <Ellipse Fill="#FF509545"
                         HorizontalAlignment="Left"
                         Height="33"
                         Margin="62,653,0,0"
                         Stroke="Black"
                         VerticalAlignment="Top"
                         Width="35" />
                <TextBlock HorizontalAlignment="Left"
                           Margin="188,658,0,0"
                           TextWrapping="Wrap"
                           VerticalAlignment="Top"
                           Foreground="#FF0A0101"
                           Height="22"
                           FontSize="16"
                           Text="Input Property" />
                <TextBlock HorizontalAlignment="Left"
                           Height="40"
                           Margin="68,573,0,0"
                           TextWrapping="Wrap"
                           Text="+ - / x"
                           VerticalAlignment="Top"
                           Width="102"
                           Foreground="#FF1313DE"
                           FontSize="32"
                           FontWeight="Bold" />
                <TextBlock HorizontalAlignment="Left"
                           Margin="91,640,0,0"
                           TextWrapping="Wrap"
                           Text="Name"
                           VerticalAlignment="Top"
                           Foreground="#FF170101"
                           RenderTransformOrigin="-32.691,-18.534"
                           FontSize="9.333" />
                <TextBlock HorizontalAlignment="Left"
                           Margin="91,680,0,0"
                           TextWrapping="Wrap"
                           Text="Name"
                           VerticalAlignment="Top"
                           Foreground="#FF170101"
                           RenderTransformOrigin="-32.691,-18.534"
                           FontSize="9.333" />
                <TextBlock HorizontalAlignment="Left"
                           Margin="188,584,0,0"
                           TextWrapping="Wrap"
                           VerticalAlignment="Top"
                           Foreground="#FF0A0101"
                           Height="22"
                           FontSize="16"
                           Text="Math operation applied to the source property's value before it is added to the sink property" />
                <Path Data="M184,284"
                      Fill="#FF0A0101"
                      HorizontalAlignment="Left"
                      Height="0"
                      Margin="184,284,0,0"
                      Stretch="Fill"
                      Stroke="Black"
                      UseLayoutRounding="False"
                      VerticalAlignment="Top"
                      Width="0" />

                <Rectangle Fill="White"
                           HorizontalAlignment="Left"
                           Height="270"
                           Margin="540,118,0,0"
                           Stroke="Black"
                           VerticalAlignment="Top"
                           Width="229"
                           StrokeThickness="3"
                           RadiusX="5"
                           RadiusY="5" />
                <Rectangle Fill="Black"
                           HorizontalAlignment="Left"
                           Height="4"
                           Margin="544,151,0,0"
                           Stroke="Black"
                           StrokeThickness="2"
                           VerticalAlignment="Top"
                           Width="225" />
                <TextBlock HorizontalAlignment="Left"
                           TextAlignment="Center"
                           Height="30"
                           Margin="542,124,0,0"
                           TextWrapping="Wrap"
                           Foreground="Black"
                           Text="Destination"
                           VerticalAlignment="Top"
                           Width="227"
                           FontSize="21.333" />
                <Ellipse Fill="#FF509545"
                         HorizontalAlignment="Left"
                         Height="73"
                         Margin="611,303,0,0"
                         Stroke="Black"
                         VerticalAlignment="Top"
                         Width="74" />
                <Rectangle Fill="#FF0A0101"
                           HorizontalAlignment="Left"
                           Height="5.103"
                           Margin="617.591,265.222,0,0"
                           Stroke="Black"
                           VerticalAlignment="Top"
                           Width="57.052"
                           RenderTransformOrigin="0.5,0.5"
                           UseLayoutRounding="False"
                           >
                    <Rectangle.RenderTransform>
                        <RotateTransform Angle="-89.491"
                                             />
                    </Rectangle.RenderTransform>
                </Rectangle>
                <TextBox HorizontalAlignment="Left"
                         Margin="615,324,0,0"
                         TextWrapping="Wrap"
                         Text="{Binding Destination.B1, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                         VerticalAlignment="Top"
                         Height="33"
                         Width="65"
                         TextAlignment="Center"
                         FontSize="24" />
                <TextBlock HorizontalAlignment="Left"
                           Margin="672,363,0,0"
                           TextWrapping="Wrap"
                           Text="B1"
                           VerticalAlignment="Top"
                           Foreground="#FF170101" />
                <Ellipse Fill="#FF454595"
                         HorizontalAlignment="Left"
                         Height="73"
                         Margin="611,159,0,0"
                         Stroke="Black"
                         VerticalAlignment="Top"
                         Width="74" />
                <TextBlock HorizontalAlignment="Left"
                           Margin="612,182,0,0"
                           TextWrapping="Wrap"
                           Text="{Binding Destination.A1}"
                           Foreground="White"
                           VerticalAlignment="Top"
                           FontSize="24"
                           Width="69"
                           Height="29"
                           TextAlignment="Center" />
                <Path Data="M150,250 L200,200 L250,250"
                      Fill="#FF0A0101"
                      HorizontalAlignment="Left"
                      Height="27.831"
                      Margin="635.924,234.066,0,0"
                      Stretch="Fill"
                      Stroke="Black"
                      UseLayoutRounding="False"
                      VerticalAlignment="Top"
                      Width="22.503"
                      RenderTransformOrigin="0.5,0.5">
                    <Path.RenderTransform>
                        <RotateTransform Angle="-0.961" />
                    </Path.RenderTransform>
                </Path>
                <TextBlock HorizontalAlignment="Left"
                           Margin="673,219,0,0"
                           TextWrapping="Wrap"
                           Text="A1"
                           VerticalAlignment="Top"
                           Foreground="#FF170101" />
                <Rectangle Fill="White"
                           HorizontalAlignment="Left"
                           Height="270"
                           Margin="208,118,0,0"
                           Stroke="Black"
                           VerticalAlignment="Top"
                           Width="229"
                           StrokeThickness="3"
                           RadiusX="5"
                           RadiusY="5" />
                <Rectangle Fill="Black"
                           HorizontalAlignment="Left"
                           Height="4"
                           Margin="212,151,0,0"
                           Stroke="Black"
                           StrokeThickness="2"
                           VerticalAlignment="Top"
                           Width="225" />
                <TextBlock HorizontalAlignment="Left"
                           TextAlignment="Center"
                           Height="30"
                           Margin="210,124,0,0"
                           TextWrapping="Wrap"
                           Foreground="Black"
                           Text="External Source 1"
                           VerticalAlignment="Top"
                           Width="227"
                           FontSize="21.333" />
                <Ellipse Fill="#FF509545"
                         HorizontalAlignment="Left"
                         Height="73"
                         Margin="279,303,0,0"
                         Stroke="Black"
                         VerticalAlignment="Top"
                         Width="74" />
                <Rectangle Fill="#FF0A0101"
                           HorizontalAlignment="Left"
                           Height="5.103"
                           Margin="285.562,265.222,0,0"
                           Stroke="Black"
                           VerticalAlignment="Top"
                           Width="57.052"
                           RenderTransformOrigin="0.5,0.5"
                           UseLayoutRounding="False"
                           >
                    <Rectangle.RenderTransform>
                        <RotateTransform Angle="-89.491"
                                             />
                    </Rectangle.RenderTransform>
                </Rectangle>
                <TextBox HorizontalAlignment="Left"
                         Margin="283,324,0,0"
                         TextWrapping="Wrap"
                         Text="{Binding ExternalSource1.B1, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                         VerticalAlignment="Top"
                         Height="33"
                         Width="65"
                         TextAlignment="Center"
                         FontSize="24" />
                <TextBlock HorizontalAlignment="Left"
                           Margin="340,363,0,0"
                           TextWrapping="Wrap"
                           Text="B1"
                           VerticalAlignment="Top"
                           Foreground="#FF170101" />
                <Ellipse Fill="#FF454595"
                         HorizontalAlignment="Left"
                         Height="73"
                         Margin="279,159,0,0"
                         Stroke="Black"
                         VerticalAlignment="Top"
                         Width="74" />
                <TextBlock HorizontalAlignment="Left"
                           Margin="280,182,0,0"
                           TextWrapping="Wrap"
                           Text="{Binding ExternalSource1.A1}"
                           Foreground="White"
                           VerticalAlignment="Top"
                           FontSize="24"
                           Width="69"
                           Height="29"
                           TextAlignment="Center" />
                <Path Data="M150,250 L200,200 L250,250"
                      Fill="#FF0A0101"
                      HorizontalAlignment="Left"
                      Height="27.831"
                      Margin="303.895,234.066,0,0"
                      Stretch="Fill"
                      Stroke="Black"
                      UseLayoutRounding="False"
                      VerticalAlignment="Top"
                      Width="22.503"
                      RenderTransformOrigin="0.5,0.5">
                    <Path.RenderTransform>
                        <RotateTransform Angle="-0.961" />
                    </Path.RenderTransform>
                </Path>
                <TextBlock HorizontalAlignment="Left"
                           Margin="341,219,0,0"
                           TextWrapping="Wrap"
                           Text="A1"
                           VerticalAlignment="Top"
                           Foreground="#FF170101" />
                <Rectangle Fill="White"
                           HorizontalAlignment="Left"
                           Height="270"
                           Margin="894,118,0,0"
                           Stroke="Black"
                           VerticalAlignment="Top"
                           Width="229"
                           StrokeThickness="3"
                           RadiusX="5"
                           RadiusY="5" />
                <TextBlock HorizontalAlignment="Left"
                           TextAlignment="Center"
                           Height="30"
                           Margin="896,124,0,0"
                           TextWrapping="Wrap"
                           Foreground="Black"
                           Text="External Source 2"
                           VerticalAlignment="Top"
                           Width="227"
                           FontSize="21.333" />
                <Rectangle Fill="White"
                           HorizontalAlignment="Left"
                           Height="48"
                           Margin="60,705,0,0"
                           Stroke="Black"
                           VerticalAlignment="Top"
                           Width="110"
                           StrokeThickness="3"
                           RadiusX="5"
                           RadiusY="5" />
                <Rectangle Fill="Black"
                           HorizontalAlignment="Left"
                           Height="4"
                           Margin="898,150,0,0"
                           Stroke="Black"
                           StrokeThickness="2"
                           VerticalAlignment="Top"
                           Width="225" />
                <Rectangle Fill="Black"
                           HorizontalAlignment="Left"
                           Height="4"
                           Margin="62,724,0,0"
                           Stroke="Black"
                           StrokeThickness="2"
                           VerticalAlignment="Top"
                           Width="108" />
                <TextBlock HorizontalAlignment="Left"
                           Margin="188,706,0,0"
                           TextWrapping="Wrap"
                           VerticalAlignment="Top"
                           Foreground="#FF0A0101"
                           Height="22"
                           FontSize="16"
                           Text="Entity, represented by an instance of a class" />
                <TextBlock HorizontalAlignment="Left"
                           Height="40"
                           Margin="269,258,0,0"
                           TextWrapping="Wrap"
                           Text="x3"
                           VerticalAlignment="Top"
                           Width="48"
                           Foreground="#FF1313DE"
                           FontSize="32"
                           FontWeight="Bold" />
                <TextBlock HorizontalAlignment="Left"
                           Height="40"
                           Margin="615,258,0,0"
                           TextWrapping="Wrap"
                           Text="+"
                           VerticalAlignment="Top"
                           Width="48"
                           Foreground="#FF1313DE"
                           FontSize="32"
                           FontWeight="Bold" />
                <Ellipse Fill="#FF454595"
                         HorizontalAlignment="Left"
                         Height="73"
                         Margin="975,159,0,0"
                         Stroke="Black"
                         VerticalAlignment="Top"
                         Width="74" />
                <TextBlock HorizontalAlignment="Left"
                           Margin="976,182,0,0"
                           TextWrapping="Wrap"
                           Text="{Binding ExternalSource2.A1}"
                           Foreground="White"
                           VerticalAlignment="Top"
                           FontSize="24"
                           Width="69"
                           Height="29"
                           TextAlignment="Center" />
                <TextBlock HorizontalAlignment="Left"
                           Margin="1037,219,0,0"
                           TextWrapping="Wrap"
                           Text="A1"
                           VerticalAlignment="Top"
                           Foreground="#FF170101" />
                <TextBlock HorizontalAlignment="Left"
                           Height="40"
                           Margin="269,258,0,0"
                           TextWrapping="Wrap"
                           Text="x3"
                           VerticalAlignment="Top"
                           Width="48"
                           Foreground="#FF1313DE"
                           FontSize="32"
                           FontWeight="Bold" />
                <Ellipse Fill="#FF509545"
                         HorizontalAlignment="Left"
                         Height="73"
                         Margin="975,303,0,0"
                         Stroke="Black"
                         VerticalAlignment="Top"
                         Width="74" />
                <Rectangle Fill="#FF0A0101"
                           HorizontalAlignment="Left"
                           Height="5.103"
                           Margin="981.932,265.222,0,0"
                           Stroke="Black"
                           VerticalAlignment="Top"
                           Width="57.052"
                           RenderTransformOrigin="0.5,0.5"
                           UseLayoutRounding="False"
                           >
                    <Rectangle.RenderTransform>
                        <RotateTransform Angle="-89.491"
                                             />
                    </Rectangle.RenderTransform>
                </Rectangle>
                <TextBox HorizontalAlignment="Left"
                         Margin="979,324,0,0"
                         TextWrapping="Wrap"
                         Text="{Binding ExternalSource2.B1, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                         VerticalAlignment="Top"
                         Height="33"
                         Width="65"
                         TextAlignment="Center"
                         FontSize="24" />
                <TextBlock HorizontalAlignment="Left"
                           Margin="1036,363,0,0"
                           TextWrapping="Wrap"
                           Text="B1"
                           VerticalAlignment="Top"
                           Foreground="#FF170101" />
                <Path Data="M150,250 L200,200 L250,250"
                      Fill="#FF0A0101"
                      HorizontalAlignment="Left"
                      Height="27.831"
                      Margin="1000.265,234.066,0,0"
                      Stretch="Fill"
                      Stroke="Black"
                      UseLayoutRounding="False"
                      VerticalAlignment="Top"
                      Width="22.503"
                      RenderTransformOrigin="0.5,0.5">
                    <Path.RenderTransform>
                        <RotateTransform Angle="-0.961" />
                    </Path.RenderTransform>
                </Path>
                <TextBlock HorizontalAlignment="Left"
                           Height="40"
                           Margin="965,258,0,0"
                           TextWrapping="Wrap"
                           Text="x3"
                           VerticalAlignment="Top"
                           Width="48"
                           Foreground="#FF1313DE"
                           FontSize="32"
                           FontWeight="Bold" />
                <TextBlock HorizontalAlignment="Left"
                           Height="40"
                           Margin="965,258,0,0"
                           TextWrapping="Wrap"
                           Text="x3"
                           VerticalAlignment="Top"
                           Width="48"
                           Foreground="#FF1313DE"
                           FontSize="32"
                           FontWeight="Bold" />
                <Button Content="Use External Source 1"
                        Command="{Binding UseExternalSource1Command}"
                        HorizontalAlignment="Left"
                        Height="40"
                        Margin="235,73,0,0"
                        VerticalAlignment="Top"
                        Width="183"
                        Visibility="{Binding IsUsingExternalSource1, Converter={StaticResource BooleanToVisibilityConverterInverted}}" />
                <Button Content="Use External Source 2"
                        Command="{Binding UseExternalSource2Command}"
                        HorizontalAlignment="Left"
                        Height="40"
                        Margin="918,73,0,0"
                        VerticalAlignment="Top"
                        Width="183"
                        Visibility="{Binding IsUsingExternalSource1, Converter={StaticResource BooleanToVisibilityConverter}}" />

                <Rectangle Visibility="{Binding IsUsingExternalSource1, Converter={StaticResource BooleanToVisibilityConverter}}"
                           Fill="#FF0A0101"
                           HorizontalAlignment="Left"
                           Height="5.103"
                           Margin="364.538,195.002,0,0"
                           Stroke="Black"
                           VerticalAlignment="Top"
                           Width="210.759"
                           RenderTransformOrigin="0.5,0.5"
                           UseLayoutRounding="False"
                           >
                    <Rectangle.RenderTransform>
                        <RotateTransform Angle="-179.776"
                                             />
                    </Rectangle.RenderTransform>
                </Rectangle>
                <Path Visibility="{Binding IsUsingExternalSource1, Converter={StaticResource BooleanToVisibilityConverter}}"
                      Data="M150,250 L200,200 L250,250"
                      Fill="#FF0A0101"
                      HorizontalAlignment="Left"
                      Height="27.831"
                      Margin="560.031,182.813,0,0"
                      Stretch="Fill"
                      Stroke="Black"
                      UseLayoutRounding="False"
                      VerticalAlignment="Top"
                      Width="22.503"
                      RenderTransformOrigin="0.5,0.5">
                    <Path.RenderTransform>
                        <RotateTransform Angle="90.269" />
                    </Path.RenderTransform>
                </Path>
                <TextBlock Visibility="{Binding IsUsingExternalSource1, Converter={StaticResource BooleanToVisibilityConverter}}"
                           HorizontalAlignment="Left"
                           Height="40"
                           Margin="470,161,0,0"
                           TextWrapping="Wrap"
                           Text="+"
                           VerticalAlignment="Top"
                           Width="48"
                           Foreground="#FF1313DE"
                           FontSize="32"
                           FontWeight="Bold" />
                <Rectangle Visibility="{Binding IsUsingExternalSource1, Converter={StaticResource BooleanToVisibilityConverterInverted}}"
                           Fill="#FF0A0101"
                           HorizontalAlignment="Left"
                           Height="5.103"
                           Margin="733.538,195.002,0,0"
                           Stroke="Black"
                           VerticalAlignment="Top"
                           Width="210.759"
                           RenderTransformOrigin="0.5,0.5"
                           UseLayoutRounding="False"
                           >
                    <Rectangle.RenderTransform>
                        <RotateTransform Angle="-179.776"
                                             />
                    </Rectangle.RenderTransform>
                </Rectangle>
                <Path Visibility="{Binding IsUsingExternalSource1, Converter={StaticResource BooleanToVisibilityConverterInverted}}"
                      Data="M150,250 L200,200 L250,250"
                      Fill="#FF0A0101"
                      HorizontalAlignment="Left"
                      Height="27.831"
                      Margin="715.031,182.813,0,0"
                      Stretch="Fill"
                      Stroke="Black"
                      UseLayoutRounding="False"
                      VerticalAlignment="Top"
                      Width="22.503"
                      RenderTransformOrigin="0.5,0.5">
                    <Path.RenderTransform>
                        <RotateTransform Angle="-86.915" />
                    </Path.RenderTransform>
                </Path>
                <TextBlock Visibility="{Binding IsUsingExternalSource1, Converter={StaticResource BooleanToVisibilityConverterInverted}}"
                           HorizontalAlignment="Left"
                           Height="40"
                           Margin="821,161,0,0"
                           TextWrapping="Wrap"
                           Text="+"
                           VerticalAlignment="Top"
                           Width="48"
                           Foreground="#FF1313DE"
                           FontSize="32"
                           FontWeight="Bold" />

            </Grid>
        </Viewbox>
    </DataTemplate>
</ResourceDictionary>